草图工作台用于创建用于 零件工作台、 建筑工作台和其他工作台的二维几何图形。 通常,二维绘图被视为大多数CAD模型的起点,因为二维草图可以“拉伸”以创建三维形状;进一步的二维草图可以用于在先前构建的三维形状的基础上创建其他特征,如开槽“Pocket”、隆起“ridges”或拉伸。 草图绘制器与在零件设计工作台中定义的布尔操作一起构成了构建实体的构造实体几何方法的基础。此外,草图绘制器还与零件设计工作台操作一起构成了创建实体的特征编辑方法的基础。
Together with boolean operations defined in the Part Workbench, the Sketcher Workbench, or "The Sketcher" for short, forms the basis of the constructive solid geometry (CSG) method of building solids. Together with
PartDesign Workbench operations, it also forms the basis of the feature editing methodology of creating solids. But many other workbenches use sketches as well.
草图工作台本身具有约束条件 - 允许将2D形状约束到精确的几何定义。以及一个约束求解器,它计算二维几何约束范围,并允许对草图自由度的交互式探索。
草图编辑器不打算制作2D蓝图。草图一旦用于生成实体特征后,会自动隐藏。约束仅在草图编辑模式下可见。
一个全约束草图
使用约束来限制对象的自由度。例如,没有约束的线条具有4 自由度(简写为“DOF”):可以水平或垂直移动,可以被拉伸,并且可以旋转。
应用水平或垂直约束或角度约束(相对于另一条线或与其中一条轴)将限制其旋转能力,从而使其具有3个自由度。锁定其原点之一的点将消除另外2个自由度。并且应用维度约束将消除最后的自由度。然后,该行被认为是“完全受限制的”。
多个对象可以彼此约束。可以通过其中一个点与重合点约束连接两条线。可以在它们之间设置一个角度,或者它们可以垂直设置。一条线可以与弧或圆相切,依此类推。具有多个对象的复杂草图将具有多种不同的解决方案,并使其“完全受约束”,这意味着基于所应用的约束只能达到其中一种可能的解决方案。
有两种约束:几何和尺寸。它们在下面的'工具'部分中详细介绍。
When a driving dimensional constraint is created, and if the Ask for value after creating a dimensional constraint preference is selected (default), a dialog opens to edit its value.
You can enter a numerical value or an expression, and it is possible to name the constraint to facilitate its use in other expressions. You can also check the Reference checkbox to switch the constrain to reference mode.
To edit the value of an existing dimensional constraint do one of the following:
Dimensional constraints can be repositioned in the 3D view by dragging. Hold down the left mouse button over the constraint value and move the mouse. The symbols of geometric constraints are positioned automatically and cannot be moved.
To create a sketch that can be used as a profile for generating solids certain rules must be followed:
These rules do not apply to construction geometry (default color blue), which is not shown outside edit mode, or if the sketch is used for a different purpose. Depending on the workbench and the tool that will use the profile sketch, additional restrictions may apply.
草图工作台工具都位于加载草图工作台时出现的草图菜单中。
Some tools are also available from the 3D view context menu while a sketch is in edit mode, or from the context menus of the Sketcher Dialog.
introduced in 0.21: If a sketch is in edit mode the Structure toolbar is hidden as none of its tools can then be used.
这是创建对象的工具。
约束用于定义长度、在草图元素之间设置规则以及沿垂直和水平轴锁定草图。某些约束要求 辅助约束
The Sketcher Workbench has several drawing aids and other features that can help when creating geometry and applying constraints.
There are two continue modes: Geometry creation "Continue Mode" and Constraint creation "Continue Mode". If these are checked (default) in the preferences, related tools will restart after finishing. To exit a continuous tool press Esc or the right mouse button. This must be repeated if a continuous geometry tool has already received input. You can also exit a continuous tool by starting another geometry or constraint creation tool. Note that pressing Esc if no tool is active will exit sketch edit mode. Uncheck the Esc can leave sketch edit mode preference if you often inadvertently press Esc too many times.
In sketches that have Auto constraints checked (default) several constraints are applied automatically. The icon of a proposed automatic constraint is shown next to the cursor when it is placed correctly. Left-clicking will then apply that constraint. This is a per-sketch setting that can be changed in the Sketcher Dialog or by changing the 视图Autoconstraints property of the sketch.
The following constraints are applied automatically:
It is possible to snap to grid lines and grid intersection, to edges of geometry and midpoints of lines and arcs, and to certain angles. Please note that snapping does not produce constraints in and of itself. For example, only if Auto constraints is switched on will snapping to an edge produce a Point on object constraint. But just picking a point on the edge would then have the same result.
Depending on the selected option in the preferences only the dimensional On-View-Parameters or both the dimensional and the positional On-View-Parameters can be enabled. Positional parameters allow the input of exact coordinates, for example the center of a circle, or the start point of a line. Dimensional parameters allow the input of exact dimensions, for example the radius of a circle, or the length and angle of a line. On-View-Parameters are not available for all tools.
Determining the center point of a circle with the positional parameters enabled
Determining the radius of a circle with the dimensional parameters enabled
If values are entered and confirmed by pressing Enter or Tab, related constraints are added automatically. If two parameters are displayed at the same time, for example the X and Y coordinate of a point, it is possible to enter one value and pick a point to define the other. Depending on the object additional constraints may be required to fully constrain it. Constraints resulting from On-View-Parameters take precedence over those that may result from Auto constraints.
Arc created by entering all On-View-Parameters with resulting automatically created constraints
If the Show coordinates beside cursor while editing preference is checked (default), the parameters of the current geometry tool (coordinates, radius, or length and angle) are displayed next to the cursor. This is deactivated while On-View-Parameters are shown.
While a sketch is in edit mode the following selection methods can be used:
As elsewhere in FreeCAD, an element can be selected in the 3D view with a single left mouse click. But there is no need to hold down the Ctrl key when selecting multiple elements. Holding down that key is possible though and has the advantage that you can miss-click without losing the selection. Edges, points and constraints can be selected in this manner.
Box selection in the 3D view works without using Std BoxSelection or Std BoxElementSelection:
You can box-select edges and points, constraints cannot be box-selected.
Double-clicking an edge in the 3D view will select all edges directly and indirectly connected with that edge via endpoints. There is no need for the edges to be connected with Coincident constraints, endpoints need only have the same coordinates.
Edges and points can also be selected from the Elements section of the Sketcher Dialog, and constraints from the Constraints section of that dialog.
The standard keyboard shortcuts, Ctrl+C, Ctrl+X and Ctrl+V, can be used to copy, cut and paste selected Sketcher geometry including related constraints. But these tools are also available from the Sketch → Sketcher tools menu. They can be used within the same sketch but also between different sketches or separate instances of FreeCAD. Since the data is copied to the clipboard in the form of Python code, it can be used in other ways too (e.g. shared on the forum).
每个CAD用户随着时间的推移发展自己的工作方式,但跟随一些有用的一般原则。
The phenomenon that a fully constrained sketch, usually after a major change to one of its dimensions, reaches an unintended new state is know as "flipping". In the example below, changing one dimension completely changes the shape of the sketch. Note that the sketch with the new shape is still fully constrained.
Original sketch (left), and the same sketch after increasing the 20mm value to 1000mm (right)
This is not always practical, but changing dimension values in smaller increments can work.
The LevenbergMarquardt solver, which is not the default solver, is known to be less prone to flipping. See Sketcher Dialog for more information.
Using horizontal and vertical dimensions instead of equal constraints can prevent flipping. Points constrained by these dimensions will not switch places. In the image above the added (orange) dimensional constraints are linked to the original dimensions via expressions.
Using angular dimensions instead of horizontal and vertical constraints can also work. The angle between edges constrained by angular dimensions will not change. 180° will not become 0°, 90° will not become 270°, etc. In the image all horizontal and vertical constraints have been replaced, but just replacing two is already effective here.
The Sketcher scripting page contains examples on how to create constraints from Python scripts.
For some ideas of what can be achieved with Sketcher tools, have a look at: Sketcher examples.